﻿#include "EnemyPlaneProperty.h"
#include"Entity.h"
EnemyPlaneProperty::EnemyPlaneProperty(const QString ModelStand, const QString ModelDeath, const int MinTime, const int MaxTime, const int Steplen, const int Hp, const int score) :
	Steplen(Steplen),
	Hp(Hp), 
	score(score),
	MinTime(MinTime),
	MaxTime(MaxTime) ,
	ModelStand(ModelStand),
	ModelDeath(ModelDeath)
{ 
	if (MinTime >= MaxTime)
	{
		OutInfo;
		qWarning() << "Mixtime:" << MinTime << ">=MaxTime:" << MaxTime;
	}
	setUpTime();
}
EnemyPlaneProperty::EnemyPlaneProperty(const EnemyPlaneProperty& in)
{
	operator=(in);
}
void EnemyPlaneProperty::operator=(const EnemyPlaneProperty& in)
{ 
	Timer.setInterval(in.Timer.interval());
	Steplen = in.Steplen; 
	Hp = in.Hp;
	score = in.score;
	MinTime = in.MinTime;
	MaxTime = in.MaxTime;
	ModelStand = in.ModelStand;
	ModelDeath = in.ModelDeath;
	AutoBullet = in.AutoBullet;
	AutoBulletTime = in.AutoBulletTime;
}
void EnemyPlaneProperty::setUpTime()
{
	Timer.setInterval(random(MinTime, MaxTime));
}
void EnemyPlaneProperty::UpTime()
{
	int num = random(MinTime, MaxTime);
	//qDebug() << num;
	Timer.start(num);
}
EnemyPlaneProperty& EnemyPlaneProperty::getQuoteThis()
{
	return *this;
}
;
